package maze.logic;

import maze.model.type.Face;
import maze.view.Window;

import org.lwjgl.input.Keyboard;

public class ManualLogic extends Logic
{
	@Override
	public void init()
	{
	}

	@Override
	public void logic()
	{
		super.logic();

		if (!LogicManager.getInstance().moving)
		{
			if (Keyboard.isKeyDown(Keyboard.KEY_UP))
			{
				if (Window.getInstance().tryToFire())
					move(Face.NORTH);
			}
			else if (Keyboard.isKeyDown(Keyboard.KEY_DOWN))
			{
				if (Window.getInstance().tryToFire())
					move(Face.SOUTH);
			}
			else if (Keyboard.isKeyDown(Keyboard.KEY_LEFT))
			{
				if (Window.getInstance().tryToFire())
					move(Face.WEST);
			}
			else if (Keyboard.isKeyDown(Keyboard.KEY_RIGHT))
			{
				if (Window.getInstance().tryToFire())
					move(Face.EAST);
			}
		}
	}
}
